package oop.day01.exercise;

public class PersonTest
{
    public static void main(String[] args)
    {
        Doctor doctor = new Doctor("zh",23,"HeBeiXingTai","Nurse");
        doctor.cut();
        System.out.println(doctor.name);
        System.out.println(doctor.age);
        System.out.println(doctor.address);
    }
}

class Person
{
    String name;
    int age;
    String address;
    Person(){};
    Person(String name,int age,String address)
    {
        this.name = name;
        this.address = address;
        this.age = age;
    }
    void eat()
    {
        System.out.println(name + "is eating");
    }
    void sleep()
    {
        System.out.println(name + " is sleeping");
    }
    void sayHi()
    {
        System.out.println("hello I am " + name + " I am " + age + "years old" + " living in " + address);
    }
}


class Student extends Person
{
    String className;
    int stuId;
    Student(){};
    Student(String name,int age,String address,String className,int stuId){
        super(name,age,address);
        this.className = className;
        this.stuId = stuId;
    }
    void study()
    {
        System.out.println("name  is " + name + " stuId is " + stuId + "is studying");
    }
}
class Teacher extends Person
{
    double salary;
    Teacher(){};
    Teacher(String name,int age,String address,double salary)
    {
        super(name,age,address);
        this.salary = salary;
    }
    void teach()
    {
        System.out.println("teacher " + name + "is teaching " + "salary is" + salary);
    }

}

class Doctor extends Person
{
    String title;
    Doctor()
    {

    }
    Doctor(String name,int age,String address,String title)
    {
        super(name,age,address);
        this.title = title;
    }
    void cut()
    {
        System.out.println("doctor" + name + " is cutting. Her title is" + title );
    }

}
